package codeComposition;
import java.util.*;
import util.*;

public class ClassElement extends ObjectElement {
	String parent;
	ArrayList<ExpressionElement> exressions = new ArrayList<ExpressionElement>();
	
	public ClassElement(String s){
		super(s);
	}
	
	public ClassElement(String s, String parent){
		super(s);
		this.parent = parent;
	}
	
	public void add(ExpressionElement e){
		this.exressions.add(e);
	}
	
	public String toString(){
		String str = "";
		str = str + "class " + StringHelper.firtCharToUpperCase(this.objectName) + "(" + this.parent + "):\n";
		if(exressions.size() == 0){
			str += "\tpass\n";
		}
		for(ExpressionElement ee:exressions){
			ee.setTabNum(1);
			str += ee.toString();
		}
		return str+"\n";
	}
}
